$(function(){
	var userName = $("#txtuserName").val();
	$.ajax({
		type: "get",
		dataType: "text",
		url: ctx + "/au.do?action=3&userName="+userName,
		success: function(v){
			eval("var userJson = " + v);
			$("#txtemail").val(userJson.email);
		}
	});
});

function applySeller(){
	var email = $("#txtemail").val();
	var phone = $("#txtPhone").val();
	
	if(phone == ""){
		layer.alert("亲美美，申请电话不能为空~~~");
		return;
	}
	
	if(phone.length != 11){
		layer.alert("亲美美，申请的电话号码应该是11为~~~");
		return;
	}
	
	$.ajax({
		type: "post",
		dataType: "text",
		url: "../au.do?action=4&phone=" +phone+"&email="+email,
		success: function(v){
			if(v == "1"){
				layer.alert("亲美美，申请成功啦，我们将在24小时联系你，同时，请你注意查收邮件~~~", 9);
				setTimeout(function(){window.parent.location.href="index.jsp";},3000);
			}
		}
	});
}